#include <iostream>
#include <unordered_set>
using namespace std;

class Solution
{
public:
    int getDis(vector<int>& A, int n)
    {
        int res = INT_MIN;
        vector<int> dpmax(n), dp(n);

        for (int i = n - 1, max = -1; i >= 0; --i)
        {
            if (A[i] > max)
            {
                max = A[i];
                dpmax[i] = A[i];
            }
            else
            {
                dpmax[i] = max;
            }
        }

        for (int i = 0; i < n - 1; ++i)
        {
            dp[i] = max(0, dpmax[i + 1] - A[i]);
            res = max(res, dp[i]);
        }

        return res;
    }
};

int main()
{
    string s;
    int n = 0, l = 0, r = 0;
    cin >> n >> l >> r >> s;

    int res = 0;
    unordered_set<char> hash;

    for (int i = 0; i < n; ++i)
    {
        hash.clear();

        for (int j = i; j < n; ++j)
        {
            hash.insert(s[j]);
            if (hash.size() > r)
                break;

            if (hash.size() >= l && hash.size() <= r)
                ++res;
        }
    }

    cout << res << endl;
}
